home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / 68K Specific / A4Stuff.h next >
Encoding:
C/C++ Source or Header  |  1995-04-12  |  1.3 KB  |  58 lines  |  [TEXT/MMCC]

  1. /*
  2.  *    File:        A4Stuff.h
  3.  *                ©1993-1995 metrowerks Inc. All rights reserved
  4.  *
  5.  *    Content:    CodeResource / DRVR / DA support functions
  6.  *
  7.  *    2 macros have been added to help with setting up the global
  8.  *    world for code resources.  They are platform (68K and PPC) safe.
  9.  *    Call EnterCodeResource() when you first enter a code resource that 
  10.  *    accesses globals or strings.  Call ExitCodeResource() when you are 
  11.  *    ready to leave the code resource.  Please see SetupA4.h for similiar
  12.  *    functions to be used by callbacks in code resources.
  13.  */
  14.  
  15. #ifndef __A4STUFF__
  16. #define __A4STUFF__
  17.  
  18. #define dOpened            0x0020
  19. #define dRAMBased        0x0040
  20. #define drvrActive        0x0080
  21. #define dReadEnable        0x0100
  22. #define dWritEnable        0x0200
  23. #define dCtlEnable        0x0400
  24. #define dStatEnable        0x0800
  25. #define dNeedGoodBye    0x1000
  26. #define dNeedTime        0x2000
  27. #define    dNeedLock        0x4000
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #ifndef powerc
  34.  
  35.     #define EnterCodeResource() long oldA4 = SetCurrentA4()
  36.     #define ExitCodeResource() SetA4(oldA4)
  37.     long SetCurrentA4(void);
  38.     long SetA4(long:__D0):__D0 = 0xC18C;
  39.     long GetCurrentA4(void) = 0x200C;
  40.     pascal void UnloadA4Seg(void *);
  41.  
  42. #else
  43.  
  44.     #define EnterCodeResource()
  45.     #define ExitCodeResource()
  46.     #define SetCurrentA4()     0L
  47.     #define SetA4(x)        0L
  48.     #define GetCurrentA4()     0L
  49.     #define UnloadA4Seg(x)     0
  50.  
  51. #endif
  52.  
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56.  
  57. #endif
  58.